<?php

/**
 * Returns the first paragraph escaped
 *
 * @author    Mon Zafra <monzee at gmail>
 * @copyright (c)2009 Mon Zafra
 * @license   http://monzee.wordpress.com/license New BSD
 * @version   $Id: FirstParagraph.php 38 2009-02-18 17:12:39Z monzee $
 */
class Blog_FirstParagraph extends Zend_View_Helper_Abstract
{
    /**
     * Explodes text to array, returns first elem
     *
     * @param string $text
     * @return string
     */
    public function firstParagraph($text)
    {
        $paras = explode("\n", trim($text));
        return $this->view->escape($paras[0]);
    }

}
